const Stores = defineStore('vue-shop',() =>{
    const business = ref({});

    const redirect = ref({});

    const address = ref({});

    function $ResetBusiness()
    {
      business.value = {};
    }

    function $ResetRedirect()
    {
        redirect.value = {};
    }

    function $ResetAddress()
    {
      address.value = {};
    }

    return {
        business,
        $ResetBusiness,
        redirect,
        $ResetRedirect,
        address,
        $ResetAddress
    }
},
{
  persist: {
    key:'vue-shop',
    storage:localStorage
  }
})

export default{
    install(app){
        const stores = Stores()

        const { business,address } =storeToRefs(stores)

        app.config.globalProperties.$business = business;
        app.config.globalProperties.$stores = stores;
        app.config.globalProperties.$ResetBusiness = stores.$ResetBusiness;
        app.config.globalProperties.$address = address;
        app.config.globalProperties.$ResetAddress = stores.$ResetAddress;
    }
}